<?php
 require_once("../include/httpclient.php");
 require_once("../include/db_mysql.php");
function GetFacilityById($arg)
{
	$location='';
	$link = new SqlClass();
	//连接数据库
	$link->connect();
	//执行sql语句
	$facilityId = $arg['facilityId'];	
	$sqlCommand = "select facilityId,district_county_Id,street_doorNumber from facility where facilityId =$facilityId";	
	$result = $link->exec_sql($sqlCommand);	
	while($row=mysql_fetch_array($result))
	{	 	
		$district_county_Id = $row['district_county_Id'];
		$sqlCommand = "select district_county_Name from district_county where district_county_Id = $district_county_Id ";
		$res = $link->exec_sql($sqlCommand);
		while($eachrow = mysql_fetch_array($res))
		{			
			$location = $eachrow['district_county_Name'].$row['street_doorNumber'];		
			break;
		}
		break;						
	}		
	$link->close();	
	return json_encode($location);  
}



?>